#pragma once
#include "std/map"
#include "std/string"
#include "std/utility"
class CDBScriptInfo;
class CCharacterMgr;
class CMonParameterMgr;
class CZoneScript;
class CExpParameter;
class CFSMMgr;
class CITPMgr;
class CItemLog;
class CHSvrIO;
class CISvrIO;
class CZSAcceptHandler;
class CErrorLog;
class CMVPInfo;
class CMapInfo;
class CNpcSvr;
class CNPCAddSkillInfo;
class CPathData;
class CStatpointPerLevel;
class CItemList;
class CMaxHpSp;
class CAgitDB;
class CServerInfo;
class CCharMTInfo;
class CLogRecorder;
class CCompositionLog;
class CMakingLog;
class CGuildDB;
class CZGuildMgr;
class CImportantItem;
class CAuctionCtrl;
class CMapResMgr;
class CScriptEventMgr;
class CQuestEventMgr;
class CRefiningLog;
class CPvPScoreDB;
class CCharInfoDB;
class CPetDB;
class CMerceDB;
class CPCSkillDB;
class CCoupleInfoDB;
class CFamilyInfoDB;
class CMakerRankDB;
class CMakerRankMgr;
class CPKInfoMgr;
class CSkillTypeInfoMgr;
class CItemReuseLimit;
class CRoomMgr;
class CBuffInfoMgr;
class CSkillLog;
class CStatusLog;
class CCompositionLog;
class CPresentLog;
class CHomunLog;
class CMercenaryLog;
class CPetLog;
class CStatusPlusInfoByJLV;
class CLottoDB;
class CStorePasswordDB;
class CMEventDB;
class CPEventDB;
class CGlobalVarDB;
class CJobCodeForItem;
class CSpecialItemMgr;
class CPetDefaultValue;
class CSummonMonsterTable;
class CNAsyncDBWorkIdentityGenerator;
class CProcessTimeChecker;
class CTestButton;
struct EQUIPSLOTINFO;


// global variables
extern hook_val<double[10]> g_ProcessTimeList;
extern hook_val<double[2]> g_NpcProcessTimeList;
extern hook_val<long> g_curTime;
extern hook_val<double> g_ProcessTime;
extern hook_val<double> g_MaxProcessTime;
extern hook_val<int> g_loopCountPerSec;
extern hook_val<int> g_isMobileEventOn;
extern hook_val<int> g_isGameGuardOn;
extern hook_val<int> g_isGameGuardInitTime;
extern hook_val<int> g_characterServerPort;
extern hook_val<HWND> g_hWnd;
extern hook_val<bool> g_IsNpcSvrOn;
extern hook_val<char[256]> g_dbPWD;
extern hook_val<char[256]> g_GlobaldbPWD;
extern hook_val<unsigned long[8]> g_tick;
extern hook_val<int> g_isCriticalLog;
extern hook_val<bool> g_IsDisconnectAll;
extern hook_val<int> g_isNpcSkip;
extern hook_val<int> g_lottoCheck;
extern hook_val<int> g_storePasswordCheck;
extern hook_val<int> g_cashShopPasswordCheck;
extern hook_val<char[260]> g_szCriticalLogFileName;
extern hook_val<char[260]> g_szTraceLogFileName;
extern hook_val<const char[9]> g_infFile;
extern hook_val<const int> SECTION_SIZE;
extern hook_val<HANDLE> g_completionPort;
extern hook_val<void*> ggGlobal;
extern hook_val<int> g_ForeignCode;
extern hook_val<int> g_isSendMailOn;
extern hook_val<int> g_MaxZenyStore;
extern hook_val<int> g_MaxZenyStoreLog;
extern hook_val<int> g_ZenyChecksum;
extern hook_val<int> g_ZoneInterLoginValue;
extern hook_val<int> g_ZoneInterLoginError;
extern hook_val<int> SPEEDHACK_DETECTETIME;
extern hook_val<int> g_maxSkill;
extern hook_val<int> g_npcMemorySize;
extern hook_val<int> g_bPremium_Service;
extern hook_val<int> g_gameGuardSwitch;
extern hook_val<int> g_isKillerSystem;
extern hook_val<int> g_isGuildDelete;
extern hook_val<int> g_isGuildEmergencyCall;
extern hook_val<int> g_Free_Server;
extern hook_val<int> g_SimpleCashShop;
extern hook_val<int> g_siegeV15On;
extern hook_val<int> g_empelium_hp;
extern hook_val<int> g_StoreMaxItemSize;
extern hook_val<__int64> g_KillerExpireTime;
extern hook_val<int> g_isEventMonsterOn;
extern hook_val<int> g_isPacketLog;
extern hook_val<int> g_castleMapMoveCheck;
extern hook_val<int> g_EventLog;
extern hook_val<int> g_AMTterm;
extern hook_val<HINSTANCE> g_hInst;
extern hook_val<int[8][2]> g_backpedalTable;
extern mystd::map<int,int>& g_packetLenMap;

// global functions
extern hook_func<void (__cdecl *)(EQUIPSLOTINFO* des, EQUIPSLOTINFO* src)> CopyEquipItemSlotInfo;
extern hook_func<void (__cdecl *)(char* dest, const char* src)> SetMapName;
extern hook_func<int (__cdecl *)(void)> GetLocalServerID;
extern hook_func<void (__cdecl *)(char* szString)> TrimLeft;
extern hook_func<void (__cdecl *)(char* szString)> TrimRight;
extern hook_func<bool (__cdecl *)(void)> AddDSN;
extern hook_func<void (__cdecl *)(const char *encBuf, char *decBuf)> Decrypt;
extern hook_func<int (__cdecl *)(unsigned int setting)> IsSetting;
extern hook_func<mystd::pair<bool,mystd::string> (__cdecl *)(void)> startup;
extern hook_func<int (__cdecl *)(void)> cleanup;
extern hook_func<void (__cdecl *)(unsigned int tick)> OutputStat;
extern hook_func<unsigned __int32 (__cdecl *)(const char *a1, int a2)> InitGameguardAuth;
extern hook_func<void (__cdecl *)(void)> CleanupGameguardAuth;
extern hook_func<unsigned long (__cdecl *)(struct _GG_AUTH_PROTOCOL* pBlock)> UnloadAuthProtocol;
extern hook_func<int (__cdecl *)(unsigned char* dest, unsigned long* destLen, unsigned const char* source, unsigned long sourceLen, int level)> compress2;
extern hook_func<int (__cdecl *)(unsigned char* dest, unsigned long* destLen, unsigned const char* source, unsigned long sourceLen)> uncompress;

// global objects
extern hook_val<CDBScriptInfo> g_dbScriptInfo;
extern hook_val<CCharacterMgr> g_characterMgr;
extern hook_val<CZoneScript> g_zoneScript;
extern hook_val<CMonParameterMgr> g_monParameter;
extern hook_val<CITPMgr> g_itpMgr;
extern hook_val<CItemLog> g_itemLog;
extern hook_val<CHSvrIO> g_hSvrIO;
extern hook_val<CZSAcceptHandler> g_zsAcceptHandler;
extern hook_val<CErrorLog> g_errorLogs;
extern hook_val<CMVPInfo> g_mvpInfo;
extern hook_val<CMapInfo> g_mapInfo;
extern hook_val<CNpcSvr> g_npcSvr;
extern hook_val<CPathData> g_pathData;
extern hook_val<CPathData> g_pathDataNpc;
extern hook_val<CStatpointPerLevel> g_statpointPerLevel;
extern hook_val<CFSMMgr> g_fsmMgr;
extern hook_val<CItemList> g_metalItemList;
extern hook_val<CItemList> g_weaponItemList;
extern hook_val<CItemList> g_potionItemList;
extern hook_val<CExpParameter> g_expParameter;
extern hook_val<CMaxHpSp> g_maxHpSp;
extern hook_val<CAgitDB> g_AgitDB;
extern hook_val<CServerInfo> g_serverInfo;
extern hook_val<CNPCAddSkillInfo> g_npcAddSkillInfo;
extern hook_val<CISvrIO> g_iSvrIO;
extern hook_val<CCharMTInfo> g_charMTInfo;
extern hook_val<CLogRecorder> g_logRecorder;
extern hook_val<CMakingLog> g_makingLog;
extern hook_val<CGuildDB> g_ZGuildDB;
extern hook_val<CZGuildMgr> g_ZGuildMgr;
extern hook_val<CImportantItem> g_importantItem;
extern hook_val<CAuctionCtrl> g_AuctionCtrl;
extern hook_val<CMapResMgr> g_mapResMgr;
extern hook_val<CScriptEventMgr> g_scriptEventMgr;
extern hook_val<CQuestEventMgr> g_questEventMgr;
extern hook_val<CRefiningLog> g_refiningLog;
extern hook_val<CPvPScoreDB> g_pvpScoreDB;
extern hook_val<CCharInfoDB> g_charInfoDB;
extern hook_val<CPetDB> g_petDB;
extern hook_val<CMerceDB> g_merceDB;
extern hook_val<CPCSkillDB> g_pcSkillDB;
extern hook_val<CCoupleInfoDB> g_coupleInfoDB;
extern hook_val<CFamilyInfoDB> g_familyInfoDB;
extern hook_val<CMakerRankDB> g_makerRankDB;
extern hook_val<CPKInfoMgr> g_PKInfoMgr;
extern hook_val<CSkillTypeInfoMgr> g_skillTypeInfoMgr;
extern hook_val<CItemReuseLimit> g_itemReuseLimit;
extern hook_val<CRoomMgr> g_roomMgr;
extern hook_val<CBuffInfoMgr> g_buffInfoMgr;
extern hook_val<CSkillLog> g_skillLog;
extern hook_val<CStatusLog> g_statusLog;
extern hook_val<CCompositionLog> g_compositionLog;
extern hook_val<CPresentLog> g_presentLog;
extern hook_val<CHomunLog> g_homunLog;
extern hook_val<CMercenaryLog> g_MercenaryLog;
extern hook_val<CPetLog> g_petLog;
extern hook_val<CStatusPlusInfoByJLV> g_StatusPlusnfoByJLV;
extern hook_val<CLottoDB> g_lottoDB;
extern hook_val<CStorePasswordDB> g_storePasswordDB;
extern hook_val<CMEventDB> g_MEventDB;
extern hook_val<CPEventDB> g_PEventDB;
extern hook_val<CGlobalVarDB> g_globalVarDB;
extern hook_val<CJobCodeForItem> g_jobCodeForItem;
extern hook_val<CSpecialItemMgr> g_specialItmMgr;
extern hook_val<CPetDefaultValue> g_petDefaultValue;
extern hook_val<CSummonMonsterTable> g_summonMonsterTable;
extern hook_val<CMakerRankMgr> g_makerRankMgr;
extern hook_val<CProcessTimeChecker> g_BodyItemLoadProcssTime;
extern hook_val<CProcessTimeChecker> g_StoreItemLoadProcssTime;
extern hook_val<CTestButton> ToggleButtonCriticalLog;
extern hook_val<CTestButton> ToggleButtonTraceLog;
